//
//  WorkHomeVC.m
//  XLDoctor
//
//  Created by longma on 2018/7/27.
//  Copyright © 2018年 XLH. All rights reserved.
//

#import "UpgradeGoutSchemeView.h"
#import "UpdateServiceView.h"
@interface UpgradeGoutSchemeView ()

@property (weak, nonatomic) IBOutlet MJUIAlertVCBaseView *baseAlertView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *contentRight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *contentTop;
@property (weak, nonatomic) IBOutlet UIView *contentView;
@property (weak, nonatomic) IBOutlet UILabel *maleLabel;
@property (weak, nonatomic) IBOutlet UILabel *feMaleLabel;
@end

@implementation UpgradeGoutSchemeView
#pragma mark - 系统

- (void)viewDidLoad {
    [super viewDidLoad];
    [self updateUI];
}

- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];

}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
}

- (void)dealloc{
    NSLog(@"[%@]======1111===已被释放",NSStringFromClass([self class]));
}

- (void)updateUI{
    
    self.baseAlertView.mBackgroundColor = UIColor.clearColor;
    self.baseAlertView.enableDismissWindow = true;
    self.contentView.backgroundColor = [UIColor mj_colorWithHexString:@"#000000" alpha:0.67];
    MJWeakSelf
    [self.baseAlertView initContentview:self.contentView];
    self.contentTop.constant = self.targetRect.origin.y + 30;
    self.contentRight.constant = 30;
    [self updateTopViewControllerPop:YES];
    self.baseAlertView.handleDismissBlock = ^{
        [weakSelf updateTopViewControllerPop:NO];
    };
    
    self.maleLabel.textColor = UIColor.whiteColor;
    self.feMaleLabel.textColor = UIColor.whiteColor;
    if(self.type == 0){
        self.maleLabel.textColor = UIColor.mj_appColor;
    }
    if(self.type == 1){
        self.feMaleLabel.textColor = UIColor.mj_appColor;
    }
}

/// 更新上个ViewController左滑返回控制
- (void)updateTopViewControllerPop:(BOOL)flag {
    //获取上一个viewController
    UINavigationController *nav = (UINavigationController *)self.presentingViewController;
    nav.topViewController.rt_disableInteractivePop = flag;
}

- (IBAction)handleMaleButtonClick:(UIButton *)sender {
    [self updateTopViewControllerPop:NO];
    MJWeakSelf
    [self dismissViewControllerAnimated:false completion:^{
        if(weakSelf.confirmBlock){
            weakSelf.confirmBlock(sender.tag);
        }
    }];
}




#pragma mark - 其他

#pragma mark - 代理

#pragma mark - 懒加载


@end
